home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / savetty.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.4 KB  |  53 lines

  1. #ifndef NO_MEMORY_H
  2. #include <memory.h>
  3. #endif
  4. #define    CURSES_LIBRARY    1
  5. #include <curses.h>
  6. #undef    savetty
  7.  
  8. #ifdef PDCDEBUG
  9. char *rcsid_savetty = "$Header: C:\CURSES\portable\RCS\savetty.c 2.1 1993/06/18 20:21:03 MH Rel MH $";
  10. #endif
  11.  
  12.  
  13.  
  14.  
  15. /*man-start*********************************************************************
  16.  
  17.   savetty()    - save/restore terminal modes
  18.  
  19.   X/Open Description:
  20.      These routines save and restore the state of the terminal modes.
  21.      The savetty() function saves the current state in a buffer and
  22.      resetty() restores the state to what it was at the last call to
  23.      savetty().
  24.  
  25.   PDCurses Description:
  26.      FYI: It is very unclear whether this is a duplication of the
  27.      reset_prog_mode() and reset_shell_mode() functions or whether
  28.      this is a backing store type of operation.  At this time, they
  29.      are implemented similar to the reset_*_mode() routines.
  30.  
  31.   X/Open Return Value:
  32.      The savetty() function returns OK upon success otherwise ERR is
  33.      returned.
  34.  
  35.   Portability:
  36.      PDCurses    int savetty( void );
  37.      X/Open Dec '88    int savetty( void );
  38.      SysV Curses    int savetty( void );
  39.      BSD Curses    int savetty( void );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    savetty(void)
  44. {
  45. #ifdef PDCDEBUG
  46.     if (trace_on) PDC_debug("savetty() - called\n");
  47. #endif
  48.  
  49.     c_save_tty.been_set = TRUE;
  50.     memcpy(&c_save_tty.saved, &_cursvar, sizeof(SCREEN));
  51.     return( OK );
  52. }
  53.